package com.fadadianqi.logistics.sell.dao;

import com.fadadianqi.commons.BaseDAO;
import com.fadadianqi.goods.model.Category;
import com.fadadianqi.logistics.sell.model.Item;

import java.util.Date;
import java.util.List;

public interface ItemDAO extends BaseDAO<Item> {

    List<Item> findByBillId(String billId);

    List<Item> findByBatchId(String batchId);

    List<Item> findByInventoryItemId(String inventory_item_id);

    int countBetween(Category category, Date start, Date end);

    double sumPayablesBetween(Category category, Date start, Date end);

    double sumCostBetween(Category category, Date start, Date end);

    /**
     * 统计没有退回的商品数量
     *
     * @param billId
     * @return
     */
    int countNotReturn(String billId);

    Item getItemByGoodsIdAndBillId(String goodsId, String billId);

    Double sumPurchaseBetween(Date start, Date end);

}
